;Open/Close a selection set of polyline entities.
;	The only input
;       required is the selection of the polylines to modify.  There
;       is no need to worry about not selecting non-polyline entities
;       because they will be automatically filtered out of the
;       selection set.
;
;	AUTHOR: HENRY C. FRANCIS
;		425 N. ASHE ST.
;		SOUTHERN PINES, NC 28387
;              
;		All rights reserved without prejudice.
;	Copyright:	5-17-94
;	Edited:		6-7-94
;
(DEFUN C:PLOC ( / plin edpl)
(setq ex_ploc (ukword 1 "Open Close" "Open/Close Polylines" (if ex_ploc ex_ploc "Close")))
(if (eq ex_ploc "Close")
  (setq as70 1)
  (setq as70 0)
);if
(prompt "\nSelect Polyline(s): ")
  (setq pset (ssget '((0 . "POLYLINE"))))
  (if pset
    (progn
      (setq psln (sslength pset))
      (setq cntr 0)
    )
  )
(while
  (if (and (< cntr psln) pset)
    (setq pent (entget (ssname pset cntr)))
  );if
  (progn
    (setq edpl (entget (cdar pent)))
    (if (eq (cdr (assoc 0 edpl)) "POLYLINE")
      (progn
        (setq ex_as70 (cdr(assoc 70 edpl)))
	(if (eq(boole 1 1 ex_as70)1)
	  (if (eq as70 0)
            (setq edpl
              (subst (cons 70 (- ex_as70 1))
                     (assoc 70 edpl)
                     edpl
              )
            )
	    nil
	  )
	  (if (eq as70 0)
	    nil
	    (setq edpl
	      (subst (cons 70 (+ ex_as70 1))
	             (assoc 70 edpl)
		     edpl
	      )
	    )
	  )
	)
        (entmod edpl)
      )
    )
    (setq cntr (1+ cntr))
  )
)
);DEFUN
